import axios from "axios";

export default{
    incrementWait({commit}){
    setTimeout(() => {
           commit("increment")     
    }, 2000);
    },
    incrementNWait({commit},payload){
           console.log(payload, "payload");
           setTimeout(() => {
            //我们不要在action中操作数据
            //当异步完成以后,把数据交给mutation去操作数据
            commit("incrementN", payload);
          }, 2000);   
    },
    async getMovieList({commit}){
        const result  = await axios.get(
            'https://pcw-api.iqiyi.com/search/recommend/list?channel_id=1&data_type=1&mode=11&page_id=2&ret_num=48&session=b9fd987164f6aa47fad266f57dffaa6a'
        );
        commit("setMovieList", result.data.data.list);
    }
  }